{% extends "layout.html" %}
{% from "nunjucks/switch_tree.html" import tree_menu %}

{% block title %}{{ name }} - DXR{% endblock %}

{% block site_css %}
  {{ super() }}
  <link href="{{ url_for('.static', filename='css/tree-selector.css') }}" rel="stylesheet" type="text/css" media="screen" />
{% endblock %}

{% set state_eof = True %}

{% block content %}
  <table class="folder-content">
    <thead>
      <tr>
        <th scope="col">Name</th>
        {% for header in plugin_headers %}
          <th scope="col">{{ header }}</th>
        {% endfor %}
        <th scope="col">Modified (UTC)</th>
        <th scope="col">Size</th>
      </tr>
    </thead>
    <tbody>
      {% for icon, name, modified, size, plugin_columns, relative_url in files_and_folders %}
        <tr>
          <td><a href="{{ relative_url }}" class="icon {{ icon }}">{{ name }}</a></td>
          {% for col in plugin_columns %}
            <td><a href="{{ relative_url }}">{{ col }}</a></td>
          {% endfor %}
          <td><a href="{{ relative_url }}">
            {% if modified is not none %}
              <time>{{ modified.strftime("%Y %b %d %H:%m") }}</time>
            {% endif %}
          </a></td>
          <td><a href="{{ relative_url }}">{{ '' if size is none else size|filesizeformat }}</a></td>
        </tr>
      {% endfor %}
    </tbody>
  </table>
{% endblock %}

{% block site_js %}
  {{ super() }}
  <script src="{{ url_for('.static', filename='js/tree-selector.js') }}"></script>
{% endblock %}
